package com.zhu.SupermarketInventoryManagement.controller;


import com.zhu.SupermarketInventoryManagement.model.QO.AdminQO;
import com.zhu.SupermarketInventoryManagement.model.ResultCommon;
import com.zhu.SupermarketInventoryManagement.service.AdminService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/admin/api")
public class AdminListApiController {

    @Resource
    AdminService adminService;

    @PostMapping("/list")
    public ResultCommon list(@RequestBody AdminQO adminQO) {
        return adminService.list(adminQO);
    }

    @PostMapping("/update")
    public ResultCommon update(@RequestBody AdminQO adminQO) {
        return adminService.update(adminQO);
    }

    @PostMapping("/delete/{id}")
    public ResultCommon delete(@PathVariable String id) {
        return adminService.delete(id);
    }

    @PostMapping("/add")
    public ResultCommon add(@RequestBody AdminQO adminQO) {
        return adminService.add(adminQO);
    }

}
